package GoodsBaseService

import (
	"gdshop-back-end-go/common/tools"
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/util/gconv"
)

func GoodsPageHandle(cateArr g.Map, resList g.List) g.List {
	for _, item := range resList {
		if item["store_id"] == 0 {
			item["store_name"] = "自营"
		}
		// 取出分类信息
		item["cates_text"] = tools.GetGoodsCatesText(gconv.String(item["cates"]), cateArr)

		delete(item, "cates")
		delete(item, "stock_cnf")
		delete(item, "delete_at")
	}

	return resList
}
